package com.health.memberbackstage.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.health.memberbackstage.mapper.OrdersettingMapper;
import com.health.memberbackstage.pojo.Ordersetting;
import com.health.memberbackstage.service.OrdersettingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Date;

@Service
public class OrdersettingServiceImpl extends ServiceImpl<OrdersettingMapper, Ordersetting> implements OrdersettingService {

    @Autowired
    private OrdersettingMapper ordersettingMapper;

    @Override
    public Ordersetting findByOrderDate(Date healthDate) {
        return ordersettingMapper.selectByOrderdateInteger(healthDate);
    }

    @Override
    public boolean updateReservations(Date healthDate,Integer version) {
        int res = ordersettingMapper.updateReservations(healthDate,version);
        if (res >= 1){
            return true;
        }
        return false;
    }
}
